//
//  ViewController.m
//  slider_menu
//
//  Created by 胡占峰 on 16/4/26.
//  Copyright © 2016年 yqj.cn. All rights reserved.
//

#import "ViewController.h"
#import "settingVc.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSNotificationCenter * center = [NSNotificationCenter defaultCenter];
    
    [center addObserverForName:@"setting" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
        NSNumber * num = note.userInfo[@"indexPath"];
        if([num isEqual:@0]) {
            NSLog(@"回调闭包~~~");
            
            UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
            UINavigationController *vc = [[UINavigationController alloc] initWithRootViewController:[storyboard instantiateViewControllerWithIdentifier:@"settingVc"]];
            [self presentViewController:vc animated:YES completion:^{
                
            }];

        }
        
    }];
    [center addObserverForName:@"settingpop" object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {
         [self dismissViewControllerAnimated:YES completion:nil];
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}
- (IBAction)pushBtn:(id)sender {
    [self.navigationController pushViewController:[[settingVc alloc] init] animated:YES];
}
- (void)dealloc {

}

@end
